package com.yungu.swift.assets.passenger.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import com.yungu.swift.assets.passenger.dao.PassengerInvoiceLogMapper;
import com.yungu.swift.assets.passenger.model.dto.PassengerInvoiceLogDto;
import com.yungu.swift.assets.passenger.service.PassengerInvoiceLogService;
import com.yungu.swift.base.ResponseData;
import com.yungu.swift.base.mapper.IMapper;
import com.yungu.swift.base.service.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Map;

/**
 * Created by cuixiuyin on 2018/5/18.
 */
@Service
public class PassengerInvoiceLogServiceImpl extends BaseServiceImpl<PassengerInvoiceLogDto> implements PassengerInvoiceLogService {

    @Autowired
    private PassengerInvoiceLogMapper passengerInvoiceLogMapper;

    @Override
    protected IMapper<PassengerInvoiceLogDto> getMapper() {
        return passengerInvoiceLogMapper;
    }

    @Override
    public ResponseData<PageList<PassengerInvoiceLogDto>> queryPage(Map<String, Object> params, int pageNum, int pageSize) {
        PageBounds pageBounds = new PageBounds(pageNum, pageSize);
        return ResponseData.buildSuccessResponse(passengerInvoiceLogMapper.queryPage(params, pageBounds));
    }
}
